package com.wonders.hisdoctor.station.project.record.service;

import com.wonders.hisdoctor.station.project.base.domain.*;
import com.wonders.hisdoctor.station.project.record.vo.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Description: 病例模板接口
 *
 * @author tong-aj
 * <p>
 * Create: 2021-02-23 20:42
 */
public interface IWdEditorService {

    /**
    * Description: 查询所有病例模板数据源表
    * Param: []
    * return: java.util.List<com.wonders.hisdoctor.station.project.base.domain.WdeditorDs>
    * Author: tong-aj
    * Date: 2021/2/23
    */
    List<WdeditorDs> getWDEditorDSList();

    /** Description: 根据表，查询所有字段名
     * Param: [com.wonders.hisdoctor.station.project.base.domain.WdeditorDs]
     * return: java.util.List<String>
     * Author: tong-aj
     * Date: 2021/2/23
     */
    List<String> getTableColumns(WdeditorDs wdeditorDs);

    /**
    * Description: 根据表，字段名查询所有值
    * Param: [tableName, codeColumn, valueColumn]
    * return: java.util.List<java.lang.String>
    * Author: tong-aj
    * Date: 2021/2/25
    */
    List<String> getColumnValues(String tableName, String codeColumn, String valueColumn);

    /**
    * Description: 保存接口列表
    * Param: []
    * return: java.util.List<java.lang.String>
    * Author: tong-aj
    * Date: 2021/2/24
    */
    List<String> getSaveInterface();

    /**
    * Description: 保存接口参数列表
    * Param: [interfaceName]
    * return: java.util.List<java.lang.String>
    * Author: tong-aj
    * Date: 2021/2/24
    */
    List<String> getInterfaceParams(String interfaceName);

    /**
    * Description: 保存病历模板
    * Param: [list]
    * return: void
    * Author: tong-aj
    * Date: 2021/2/25
    */
    void saveWdEditors(List<WdEditorVo> list);

    /**
    * Description: 保存模板Html信息
    * Param: [wdEditorsHtmlVo]
    * return: void
    * Author: tong-aj
    * Date: 2021/2/25
    */
    void saveWdEditorsHtml(WdEditorsHtmlVo wdEditorsHtmlVo);

    /**
    * Description: 根据modelId获取模板Html
    * Param: [modelId]
    * return: com.wonders.hisdoctor.station.project.record.vo.WdEditorsHtmlVo
    * Author: tong-aj
    * Date: 2021/2/25
    */
    WdEditorsHtmlVo getWdEditorsHtml(String modelId);

    /**
    * Description: 根据modelId查询模板下所有控件信息
    * Param: [modelId, patientId, visitNo, visitDate, request]
    * return: java.util.List<com.wonders.hisdoctor.station.project.record.vo.WdEditorVo>
    * Author: tong-aj
    * Date: 2021/3/10
    */
    List<WdEditorVo> getWdEditorsByModelId(String modelId, String patientId, String visitNo, Date visitDate, String tId,String empNo,HttpServletRequest request);

    /**
    * Description: 根据医疗机构代码合模板查询字段查询所有Model
    * Param: [hospitalCode, fastFind]
    * return: java.util.List<com.wonders.hisdoctor.station.project.base.domain.WdeditorDsset>
    * Author: tong-aj
    * Date: 2021/3/12
    */
    List<Map<String,Object>> getModelList(String hospitalCode, String fastFind);

    /**
    * Description: 批量删除模板
    * Param: [modelIds]
    * return: void
    * Author: tong-aj
    * Date: 2021/3/16
    */
    void deleteModels(List<String> modelIds);

    /**
    * Description: 保存控件的历史记录
    * Param: [list]
    * return: void
    * Author: tong-aj
    * Date: 2021/3/17
    */
    void saveHistories(List<WdeditorHistory> list);

    /**
    * Description: 通过机构代码，医生工号和个人模板名称查询个人模板数据
    * Param: [orgId, operate, templateName]
    * return: java.util.List<com.wonders.hisdoctor.station.project.base.domain.WdeditorPritemplatedetail>
    * Author: tong-aj
    * Date: 2021/3/24
    */
    List<WdeditorPritemplatedetail> getTemplateDetails(String orgId, String operate, String templateName);

    /**
    * Description: 保存个人模板
    * Param: [templateVo]
    * return: void
    * Author: tong-aj
    * Date: 2021/3/24
    */
    void saveTemplates(TemplateVo templateVo);

    /**
     * Description: 个人模板列表
     * Param: [orgId]
     * return: java.util.List<com.wonders.hisdoctor.station.project.base.domain.WdeditorPritemplatemaster>
     * Author: tong-aj
     * Date: 2021/3/24
     */
    List<TemplateListVo> getTemplateList(String orgId, String effectiveDept, String templateName, String condition);

    /**
    * Description: 批量删除模板
    * Param: [tIds]
    * return: void
    * Author: tong-aj
    * Date: 2021/4/16
    */
    void deleteTemplateList(List<String> tIds);

    /**
     * 根据modelId和setId获取该控件的静态数据字典
     * @param setId setId
     * @param dId dId
     * @return Map<String, List<Map<String, Object>>>
     */
    Map<String, List<Map<String, Object>>> getStaticDataList(String setId, String dId);

    /**
     * 通过modelId获取下拉控件的静态数据源需要信息
     * @param modelId
     * @return
     */
    List<StaticEditor> getStaticEditors(String modelId);

    /**
     * 设为默认加载模板
     * @param modelId modelId
     */
    void setDefaultModel(String orgId, String modelId);

    /**
     * 通过机构代码获取默认模板Id
     * @param orgId
     * @return
     */
    String getDefaultModelId(String orgId);
}
